<?php
class comment_widgetWidget extends Widget {

	public function render(){
        
        //instance model
        $comment_model = $this->model('comments');
        
        
        $config_data    = auth::get_config_data();
        
        if ($config_data['is_verify'] == 1) {
            $comment_data = $comment_model->from('comments', array('post_id', 'comment_content'))->where('approved=1')->order('comment_id desc')->limit(0, 10)->select();
        } else {
            $comment_data = $comment_model->from('comments', array('post_id', 'comment_content'))->order('comment_id desc')->limit(0, 10)->select();
        }
        
        //display widget
        include $this->view();
	}
}